package cn.lxh.system.controller;

import cn.lxh.system.domain.AccessToken;
import cn.lxh.system.domain.WxtemplateReq;
import cn.lxh.system.domain.wxDataReq;
import cn.lxh.system.service.WxAccountService;
import lombok.RequiredArgsConstructor;

import org.apache.commons.collections4.Get;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName WxAccountController
 * @Description 微信公众号
 * @Author luoxiaohu
 * @Date 2023/7/18 17:31
 * @Vsersion 1.0
 **/

@RestController
@RequestMapping("wx/account")
@RequiredArgsConstructor
public class WxAccountController {

    private final WxAccountService wxAccountService;

    /**
     *
     * @return
     */
    @GetMapping("getToken")
    public String getWxAccessToken(){

        return wxAccountService.getWxAccessToken();
    }


    /**
     *
     * @param req
     */
    @PostMapping("sendWxSms")
    public void sendWxSms(@RequestBody WxtemplateReq req){

        wxAccountService.sendWxSms(req);
    }

    /**
     *
     * @return
     */
    @GetMapping("saveContent")
    public Boolean saveContent(){
       return wxAccountService.getApiInfo();
    }
}
